package com.springmvc.springbootdemo;

import com.springmvc.springbootdemo.nettyservice.NettyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.net.InetSocketAddress;

@SpringBootApplication
public class SpringbootDemoApplication implements CommandLineRunner {

    @Autowired
    private NettyService nettyService;
    public static void main(String[] args) {
        SpringApplication.run(SpringbootDemoApplication.class, args);
        System.out.println("启动成功！");
    }

    @Override
    public void run(String... args) throws Exception {
        InetSocketAddress inetSocketAddress = new InetSocketAddress("127.0.0.1", 6668);
         nettyService.NettyServer(inetSocketAddress);
    }
}
